package com.cyz.service;

import java.util.Collection;
import java.util.Date;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;

import com.vsd.domain.Coupon;


public interface CouponService {
	
	Page<Coupon> findBySourceAndBeginTimeBeforeAndEndTimeAfter(Integer resource,Date beginTime,Date endTime,Pageable p);
	
	Page<Coupon> findByStoreIdAndSource(String id,Integer source,Pageable p);
	
	Coupon findByOne(String id);
	
	int updateTotal(String id,Integer num);

	Collection<Coupon> findBySourceAndBeginTimeBeforeAndEndTimeAfterAndTotalGreaterThan(
			Integer resource, Date beginTime, Date endTime, Sort sort);
	
	
	Page<Coupon> findAll(Pageable p);
	
	Coupon save(Coupon c);
	
	void delete(String id);

	int updateByPrimaryKey(Coupon c);
	
	Coupon findById(String id);
}
